<template>
      <el-submenu :index="menuitem.id" style="padding-left:0px">
          <template slot="title">
            <span>{{menuitem.menuName}}</span>
          </template>
         <div  v-for="subitem of menuitem.children" :key="subitem.id" style="background-color: #f8fcf2;">
                <el-menu-item :index="subitem.path"  v-if="subitem.children.length==0" >
                      {{subitem.menuName}} 
                </el-menu-item>
        <sub-menu :menuitem="subitem" v-else ></sub-menu>
         </div>
                
        </el-submenu>
</template>
<script>
import SubMenu from '@/views/SubMenu'

export default {
  name: 'SubMenu',
  components:{
        SubMenu
    },
   props:['menuitem']
}
</script>